#ifndef GCATEGORIES_H
#define GCATEGORIES_H

#include "lib_categories_global.h"

#include <QWidget>
#include <QSqlDatabase>
#include <QModelIndex>

#include <QMessageBox>
#include <QSettings>

#include "categoriesmodel.h"
#include "connexionbdd.h"

//#include <QtDebug>
//#include <QSqlError>

namespace Ui {
class GCategories;
}

class LIB_CATEGORIESSHARED_EXPORT GCategories : public QWidget
{
    Q_OBJECT

public:
    explicit GCategories(QWidget *parent = 0);
    ~GCategories();

    void setRoot(int r);

private slots:

    void on_treeCategories_clicked(const QModelIndex &index);
    void on_buttonControlAjouter_clicked();
    void on_buttonOrdreMoins_clicked();
    void on_buttonOrdrePlus_clicked();
    void on_buttonRaffraichir_clicked();
    void on_buttonHierarDescendre_clicked();
    void on_buttonHierarMonter_clicked();

private:
    Ui::GCategories *ui;
    CategoriesModel *model;
    int root;


};

#endif // GCATEGORIES_H
